# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Analytics.V3.Model.Filter do
  @moduledoc """
  JSON template for an Analytics account filter.

  ## Attributes

  *   `accountId` (*type:* `String.t`, *default:* `nil`) - Account ID to which this filter belongs.
  *   `advancedDetails` (*type:* `GoogleApi.Analytics.V3.Model.FilterAdvancedDetails.t`, *default:* `nil`) - Details for the filter of the type ADVANCED.
  *   `created` (*type:* `DateTime.t`, *default:* `nil`) - Time this filter was created.
  *   `excludeDetails` (*type:* `GoogleApi.Analytics.V3.Model.FilterExpression.t`, *default:* `nil`) - Details for the filter of the type EXCLUDE.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Filter ID.
  *   `includeDetails` (*type:* `GoogleApi.Analytics.V3.Model.FilterExpression.t`, *default:* `nil`) - Details for the filter of the type INCLUDE.
  *   `kind` (*type:* `String.t`, *default:* `analytics#filter`) - Resource type for Analytics filter.
  *   `lowercaseDetails` (*type:* `GoogleApi.Analytics.V3.Model.FilterLowercaseDetails.t`, *default:* `nil`) - Details for the filter of the type LOWER.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of this filter.
  *   `parentLink` (*type:* `GoogleApi.Analytics.V3.Model.FilterParentLink.t`, *default:* `nil`) - Parent link for this filter. Points to the account to which this filter belongs.
  *   `searchAndReplaceDetails` (*type:* `GoogleApi.Analytics.V3.Model.FilterSearchAndReplaceDetails.t`, *default:* `nil`) - Details for the filter of the type SEARCH_AND_REPLACE.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - Link for this filter.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Type of this filter. Possible values are INCLUDE, EXCLUDE, LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED.
  *   `updated` (*type:* `DateTime.t`, *default:* `nil`) - Time this filter was last modified.
  *   `uppercaseDetails` (*type:* `GoogleApi.Analytics.V3.Model.FilterUppercaseDetails.t`, *default:* `nil`) - Details for the filter of the type UPPER.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountId => String.t() | nil,
          :advancedDetails => GoogleApi.Analytics.V3.Model.FilterAdvancedDetails.t() | nil,
          :created => DateTime.t() | nil,
          :excludeDetails => GoogleApi.Analytics.V3.Model.FilterExpression.t() | nil,
          :id => String.t() | nil,
          :includeDetails => GoogleApi.Analytics.V3.Model.FilterExpression.t() | nil,
          :kind => String.t() | nil,
          :lowercaseDetails => GoogleApi.Analytics.V3.Model.FilterLowercaseDetails.t() | nil,
          :name => String.t() | nil,
          :parentLink => GoogleApi.Analytics.V3.Model.FilterParentLink.t() | nil,
          :searchAndReplaceDetails =>
            GoogleApi.Analytics.V3.Model.FilterSearchAndReplaceDetails.t() | nil,
          :selfLink => String.t() | nil,
          :type => String.t() | nil,
          :updated => DateTime.t() | nil,
          :uppercaseDetails => GoogleApi.Analytics.V3.Model.FilterUppercaseDetails.t() | nil
        }

  field(:accountId)
  field(:advancedDetails, as: GoogleApi.Analytics.V3.Model.FilterAdvancedDetails)
  field(:created, as: DateTime)
  field(:excludeDetails, as: GoogleApi.Analytics.V3.Model.FilterExpression)
  field(:id)
  field(:includeDetails, as: GoogleApi.Analytics.V3.Model.FilterExpression)
  field(:kind)
  field(:lowercaseDetails, as: GoogleApi.Analytics.V3.Model.FilterLowercaseDetails)
  field(:name)
  field(:parentLink, as: GoogleApi.Analytics.V3.Model.FilterParentLink)
  field(:searchAndReplaceDetails, as: GoogleApi.Analytics.V3.Model.FilterSearchAndReplaceDetails)
  field(:selfLink)
  field(:type)
  field(:updated, as: DateTime)
  field(:uppercaseDetails, as: GoogleApi.Analytics.V3.Model.FilterUppercaseDetails)
end

defimpl Poison.Decoder, for: GoogleApi.Analytics.V3.Model.Filter do
  def decode(value, options) do
    GoogleApi.Analytics.V3.Model.Filter.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Analytics.V3.Model.Filter do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
